#include "reg51.h"
#include "intrins.h"

//测试工作频率为11.0592MHz

sfr     T2L         =   0xd7;
sfr     T2H         =   0xd6;
sfr     AUXR        =   0x8e;

sbit    P10         =   P1^0;
sbit    P11         =   P1^1;

sfr P3M0        =   0xb2;
sfr P3M1        =   0xb1;
void UART1_Isr() interrupt 4
{
    if (TI)
    {
        TI = 0;                                 //清中断标志
        P10 = !P10;                             //测试端口
    }
    if (RI)
    {
        RI = 0;                                 //清中断标志
        P11 = !P11;                             //测试端口
    }
}

void main()
{
	//P3M0 = 0x00;               // 设置为准双向
    //P3M1 = 0x00;
    SCON = 0x50;
    T2L = 0xe8;                                 //65536-11059200/115200/4=0FFE8H
    T2H = 0xff;
    AUXR = 0x15;                                //启动定时器
    ES = 1;                                     //使能串口中断
    EA = 1;
    SBUF = 0x5a;                                //发送测试数据

    while (1);
}